<html>

<head>
    <meta charset="utf-8">
    <title>excel筛选功能</title>
    <link rel="stylesheet" href="../layui/css/layui.css" media="all">
</head>
<body>
<div class="layui-row" >
    <div class="layui-col-md1">
        <button type="button" class="layui-btn" id="upload">
            <i class="layui-icon">&#xe67c;</i>上传Excel
        </button>
    </div>
    <div class="layui-col-md1">
        <span >设备类型不包含：</span>
        <input class="layui-input" name="id" id="demoReload" autocomplete="off" placeholder="多个条件用,分割">
    </div>
    <div class="layui-inline">
        <span>安装地址不包含:</span>
        <input class="layui-input" name="id" id="demoReload1" autocomplete="off" placeholder="多个条件用,分割">
    </div>
    <div class="layui-inline">
        <span>接入方式:</span>
        <input class="layui-input" name="id" id="demoReload2" autocomplete="off" placeholder="多个条件用,分割">
    </div>
    <div class="layui-inline">
        <span>专业类型包含 :</span>
        <input class="layui-input" name="id" id="demoReload3" autocomplete="off" placeholder="多个条件用,分割">
    </div>
    <div class="layui-inline">
        <span>是否有关联单:</span>
        <input class="layui-input" name="id" id="demoReload6" autocomplete="off" placeholder="多个条件用,分割">
    </div>
    <div class="layui-inline">
        <span>已有ONU标识 :</span>
        <input class="layui-input" name="id" id="demoReload7" autocomplete="off" placeholder="多个条件用,分割">
    </div>
    <div class="layui-inline">
        <span>建设模式 :</span>
        <input class="layui-input" name="id" id="demoReload8" autocomplete="off" placeholder="多个条件用,分割">
    </div>
    <div class="layui-inline">
        <span>客户类别 :</span>
        <input class="layui-input" name="id" id="demoReload9" autocomplete="off" placeholder="多个条件用,分割">
    </div>
    <div class="layui-inline">
        <span>设备类型包含 :</span>
        <input class="layui-input" name="id" id="demoReload10" autocomplete="off" placeholder="多个条件用,分割">
    </div>
    <div class="layui-inline">
        <span>安装地址包含 :</span>
        <input class="layui-input" name="id" id="demoReload11" autocomplete="off" placeholder="多个条件用,分割">
    </div>
    <button id="reset" type="button" class="layui-btn">重置条件</button>
    <button class="layui-btn" data-type="reload">搜索</button>
    <button id="export" type="button" class="layui-btn">导出</button>
<!--    <a target="_blank" class="layui-btn " onclick="toNewPage()">导出</a>-->
    <button id="delete" type="button" class="layui-btn layui-btn-danger">清空数据</button>
</div>
<table id="data" lay-filter="test"></table>

<script src="../layui/layui.all.js"></script>
<script>

    //列表
    function rendTable() {
        //执行的代码
        var table = layui.table;
        //执行渲染
        var tableIns = table.render({
            elem: '#data' //指定原始表格元素选择器（推荐id选择器）
            , url: '/bussiness/page'
            , cols: [
                [
                    {field: 'workOrder', title: '工单流水号'},
                    {field: 'bureauDirection', title: '局向'},
                    {field: 'region', title: '区域'},
                    {field: 'transferBox', title: '交接箱'},
                    {field: 'junctionBox', title: '分线盒'},
                    {field: 'marketingCenter', title: '营销中心'},
                    {field: 'processingDepartment', title: '处理部门'},
                    {field: 'handlingPost', title: '处理岗位'},
                    {field: 'handler', title: '处理人'},
                    {field: 'processingLaborNumber', title: '处理人工号'},
                    {field: 'ibssSystemNumber', title: 'IBSS系统受理工号'},
                    {field: 'ibssWorkNumber', title: 'IBSS工单号'},
                    {field: 'businessType', title: '业务类型'},
                    {field: 'constructionAction', title: '施工动作'},
                    {field: 'constructionType', title: '施工类型'},
                    {field: 'majorType', title: '专业类型'},
                    {field: 'userLevel', title: '用户等级'},
                    {field: 'appointment', title: '是否预约'},
                    {field: 'appointmentTimely', title: '预约是否及时'},
                    {field: 'timeOut', title: '是否超时'},
                    {field: 'performance', title: '是否履约'},
                    {field: 'changeOfContract', title: '是否改约'},
                    {field: 'applicationNumber', title: '申请编号'},
                    {field: 'orderCode', title: '订单编码'},
                    {field: 'businessNumber', title: '业务号码'},
                    {field: 'adslNumber', title: 'ADSL关联号码'},
                    {field: 'paymentMethod', title: '付费方式'},
                    {field: 'userName', title: '用户名称'},
                    {field: 'userType', title: '用户类型'},
                    {field: 'packageType', title: '套餐类型'},
                    {field: 'installationAddress', title: '安装地址'},
                    {field: 'contacts', title: '联系人'},
                    {field: 'contactNumber', title: '联系电话'},
                    {field: 'firstArrivalTime', title: '首次到单时间'},
                    {field: 'arrivalTime', title: '到单时间'},
                    {field: 'acceptanceTime', title: '受理时间'},
                    {field: 'firstAppointmentOperationTime', title: '首次预约操作时间'},
                    {field: 'appointmentOperationTime', title: '预约操作时间'},
                    {field: 'appointmentStartTime', title: '预约开始时间'},
                    {field: 'appointmentEndTime', title: '预约结束时间'},
                    {field: 'receiptTime', title: '回单时间'},
                    {field: 'filingTime', title: '归档时间'},
                    {field: 'archiveMode', title: '归档模式'},
                    {field: 'totalInstalledTime', title: '装机总历时'},
                    {field: 'expeditingTimes', title: '催装次数'},
                    {field: 'firstExpeditingTime', title: '首次催装时间'},
                    {field: 'finalExpeditingTime', title: '最后催装时间'},
                    {field: 'associatedWithUserApplicationNumber', title: '是否关联用户申请编号'},
                    {field: 'broadbandAccount', title: '宽带账号'},
                    {field: 'receiptMethod', title: '回单方式'},
                    {field: 'days15Report', title: '15天报障MAINSN'},
                    {field: 'numberOfContractChanges', title: '改约次数'},
                    {field: 'accessMode', title: '接入方式'},
                    {field: 'terminalName', title: '终端设备名称'},
                    {field: 'equipmentSupplyMode', title: '设备提供方式'},
                    {field: 'communicationRate', title: '通信速率'},
                    {field: 'adslRate', title: '原ADSL速率'},
                    {field: 'lineInformation', title: '线路信息'},
                    {field: 'originalInstallationAddress', title: '原安装地址'},
                    {field: 'deliveryTime', title: '派单时间'},
                    {field: 'peopleContactNumber', title: '施工人联系电话'},
                    {field: 'handlingNotes', title: '处理备注'},
                    {field: 'loadingAgent', title: '揽装人'},
                    {field: 'mdfColumn', title: 'MDF横列'},
                    {field: 'mdfInLine', title: 'MDF直列'},
                    {field: 'experienceRate', title: '体验速率'},
                    {field: 'historicalServiceOpeningTimes', title: '历史退回服开次数'},
                    {field: 'onuName', title: 'ONU名称'},
                    {field: 'onuType', title: 'ONU类型'},
                    {field: 'testComplianceStatus', title: '测试达标状态'},
                    {field: 'reasonsForNonCompliance', title: '不达标原因'},
                    {field: 'hdItvLogo', title: '高清ITV标志'},
                    {field: 'broadbandIdentification', title: '宽带标识'},
                    {field: 'broadBandCategory', title: '宽带大类'},
                    {field: 'broadbandSubcategory', title: '宽带小类'},
                    {field: 'workOrderNotes', title: '工单备注'},
                    {field: 'fl70h', title: '预约成功时间'},
                    {field: 'f4834', title: '移机方式'},
                    {field: 'pcg9l', title: '建设模式（皮缆）'},
                    {field: 'i8oi1', title: 'LAN速率'},
                    {field: 'xnd82', title: '现ONU编码'},
                    {field: 'ojz73', title: '现分光器编码'},
                    {field: 's3089', title: '已有ONU标识'},
                    {field: 'wk0tm', title: '现分光器名称'},
                    {field: 'u1l4w', title: '现分光器地址'},
                    {field: 'n35d3', title: '现分光器端口'},
                    {field: 'zsnx4', title: '月租类型'},
                    {field: 'j3m8h', title: '开通FTTX回单场景'},
                    {field: 'bh818', title: 'ONU装拆移标志'},
                    {field: 'fh919', title: '节点设备名称'},
                    {field: 'e2i17', title: '客户类别'},
                    {field: 'oa026', title: '原终端设备名称'},
                    {field: 'joul7', title: '原设备提供方式'},
                    {field: 'zv1e4', title: '约单员'},
                    {field: 'w84x9', title: 'ONUSN码'},
                    {field: 'iv0za', title: '第一级异常回单原因'},
                    {field: 'k48s1', title: '第二级异常回单原因'},
                    {field: 'nj050', title: '第三级异常回单原因'},
                    {field: 'w87u0', title: '机楼'},
                    {field: 'b43c9', title: '现OLT设备名称'},
                    {field: 'k9a28', title: 'PON网络标识'},
                    {field: 'i6la3', title: '异常回填资源编码'},
                    {field: 'vn047', title: '上一次异常退单原因'},
                    {field: 'va162', title: '是否有皮缆'},
                    {field: 'yorm3', title: '皮缆是否入户'},
                    {field: 's71q7', title: '建设模式'},
                    {field: 'pw2be', title: '是否快速装机'},
                    {field: 'hxa55', title: '是否前台预约'},
                    {field: 'c4794', title: '下载速率'},
                    {field: 's00o5', title: '163后台账号上行速率'},
                    {field: 'fujuy', title: '163后台账号下行速率'},
                    {field: 'r519c', title: '光功率'},
                    {field: 'f61v6', title: '测速时间'},
                    {field: 'i8a15', title: '光施工标识'},
                    {field: 'jrzbj', title: '前台预约时间'},
                    {field: 'e4w1b', title: '打印次数'},
                    {field: 'kdom6', title: '现横列端子'},
                    {field: 'p72rc', title: '受理人姓名和联系电话'},
                    {field: 'hy56f', title: '原ONU编码'},
                    {field: 'z9sbv', title: '原分线盒号'},
                    {field: 'dkiv2', title: '回单操作人'},
                    {field: 'qf163', title: 'WIFI是否已开通'},
                    {field: 'tzitw', title: 'WIFI状态是否有变更'},
                    {field: 'z7r30', title: '设备类型'},
                    {field: 'h31q9', title: '标准地址ID'},
                    {field: 'z9s67', title: '标准地址编码'},
                    {field: 'duw97', title: '退改原因'},
                    {field: 'i641e', title: '最后改约人'},
                    {field: 'mnu4o', title: '部门分局'},
                    {field: 'ge1y3', title: '是否IMS视频通业务'},
                    {field: 'y0hde', title: '标准资源地址名称'},
                    {field: 'a43ef', title: '政企级别'},
                    {field: 'njjc5', title: '原接入方式'},
                    {field: 't7xeo', title: '现ONU设备型号'},
                    {field: 'zc042', title: '设备型号'},
                    {field: 'j8h8w', title: '营销服务中心'},
                    {field: 'ccof3', title: '施工签到时间'},
                    {field: 'i3qdq', title: '地址ID'},
                    {field: 'ohje2', title: '是否外拔'},
                    {field: 'oqe67', title: '原PON网络标识'},
                    {field: 'wb0y1', title: '现板卡类型'},
                    {field: 'ectk9', title: 'ONU装拆移标志(广州逻辑)'},
                    {field: 'd28sl', title: '原板卡类型'},
                    {field: 'hzevr', title: '是否电子签名'},
                    {field: 'y9wfr', title: '资源实配终端类型'},
                    {field: 'bvs4p', title: '短信预约是否成功'},
                    {field: 'zm11o', title: '失败时的原因'},
                    {field: 'mbmfo', title: '竣工时间'},
                    {field: 'hbn5p', title: '业务端口'},
                    {field: 'p6c02', title: '高危'},
                    {field: 'ev8p8', title: 'WIFI调测'},
                    {field: 'ub922', title: '揽装人渠道'},
                    {field: 'j458j', title: '是否预约主单'},
                    {field: 'yl05v', title: '原MDF横列端子'},
                    {field: 'hhe24', title: '现LOOP端子'},
                    {field: 'q6ub5', title: '原LOOP端子'},
                    {field: 'h6uv2', title: '短信预约回复截止时间'},
                    {field: 'wtrh0', title: '原MDF横列'},
                    {field: 'd1844', title: '原MDF直列'},
                    {field: 'ffd8g', title: '原分线盒地址'},
                    {field: 'ruo6o', title: '原分光器编码'},
                    {field: 'rv02e', title: '原分光器地址'},
                    {field: 'bjas8', title: '现场开通'},
                    {field: 's16hj', title: '短信预约结果'},
                    {field: 'oe5w2', title: '自动派单原因'},
                    {field: 'fvr0d', title: '施工人用户类型'},
                    {field: 'a437g', title: '施工人岗位类型'},
                    {field: 'j23fr', title: '短信退单结果'},
                    {field: 'pkt6g', title: '短信改约结果'},
                    {field: 'rn453', title: '网格所属营服中心'},
                    {field: 'm7s10', title: '网格名称'},
                    {field: 'mi304', title: '网格编码'},
                    {field: 'j3ozz', title: '水平工程状态'},
                    {field: 'opicf', title: 'ONU管理模式'},
                    {field: 'm52px', title: '星级服务'},
                    {field: 'nd8z5', title: '是否完成红绿灯'},
                    {field: 'oeio8', title: '是否1小时内完成放装'},
                    {field: 'o49gx', title: '预约方式'},
                    {field: 'zx6n8', title: '更换资源变更原因'},
                    {field: 'a143k', title: '是否先装后付'},
                    {field: 's9r4l', title: '城中村'},
                    {field: 'gyp5w', title: '变更光资源原因'},
                    {field: 'cq9wh', title: '电子识别码'},
                    {field: 'vuy5h', title: '是否有挂起操作'},
                    {field: 'rxm50', title: '光衰达标情况'},
                    {field: 'o666x', title: '光衰测试时'},
                    {field: 'zj82y', title: '光衰值'},
                    {field: 'g1600', title: '是否随销'},
                    {field: 'z6r31', title: '是否收费'},
                    {field: 'm03s7', title: '一次性费用'},
                    {field: 'ie314', title: '未收金额'},
                    {field: 'd6k04', title: '已收金额'},
                    {field: 'eg6t9', title: '原交接箱箱号'},
                    {field: 'r03vz', title: '重要客户备注'},
                    {field: 'oa14u', title: '客户编码'},
                    {field: 'oe7lb', title: '原标准资源地址ID'},
                    {field: 'cuuz7', title: '曾有光业务号'},
                    {field: 'l6v7v', title: '是否快装'},
                    {field: 'a879e', title: '门头到成端'},
                    {field: 'e34w4', title: '是否赔付'},
                    {field: 'nls8f', title: '是否有关联单'},
                    {field: 'nk6v1', title: '是否赔付(中山)'},
                    {field: 'h0962', title: '赔付类型(中山)'},
                    {field: 'u77g2', title: '赔付结果(中山)'},
                    {field: 'z40mo', title: '赔付类型'},
                    {field: 'nbn77', title: '赔付结果'},
                    {field: 'zlk06', title: '是否实名后置'},
                    {field: 'rs6u5', title: '慢必赔收费时间'},
                    {field: 'ck33m', title: '施工质量评价'},
                    {field: 'rg6cf', title: '服务态度评价'},
                    {field: 'bso2k', title: 'IPTV回单控制结论'},
                    {field: 'sbex4', title: 'IPTV标准组网信息'},
                    {field: 'b2kv2', title: '测光衰高权限回单'},
                    {field: 'x396c', title: '未收费高权限回单'},
                    {field: 'm252d', title: '标准组网高权限回单'},
                    {field: 'gf3ck', title: '测速高权限回单'},
                    {field: 'tsg71', title: '是否当日装'},
                    {field: 'lqh01', title: '回单前2小时内测速'},
                    {field: 'dl22a', title: '申请用途'},
                    {field: 'hq6wh', title: '终端评价'},
                    {field: 's01yh', title: '热熔保护组件评价'},
                    {field: 'rau6w', title: '首次预约上门时间'},
                    {field: 'z06es', title: '营销到达信息'},
                    {field: 'j6x33', title: '要客'},
                    {field: 'j04s2', title: '慢必赔类型'},
                    {field: 'tm4ou', title: '赔付原因'},
                    {field: 'om72n', title: '客户证件类型'},
                    {field: 'e04u9', title: '现终端来源'},
                    {field: 'rg691', title: '是否倒灌'},
                    {field: 'il8fk', title: '倒灌成功'},
                    {field: 'w29t5', title: '是否智改工单'},
                    {field: 'smgik', title: '是否智改成功'},
                    {field: 'vykk6', title: '通信安装服务'},
                    {field: 'u77h5', title: '夜间上门标识'},
                    {field: 'v6ks0', title: '专网ID'},
                    {field: 'l9gy7', title: '现场装维人员工号'},
                    {field: 'vflw4', title: '应赔金额'},
                    {field: 'thc46', title: '前台催装次数'},
                    {field: 'reemw', title: '后台催装次数'},
                ]
            ]//设置表头
            //,…… //更多参数参考右侧目录：基本参数选项
            , data: {
                "username": "1"
                , "password": "2"
            }
            , id: "table"
            , page: true
            , limit: 20
            , where: {
                //设备类型
                z7r30: null
                //安装地址
                , installationAddress: null
                //接入方式
                , accessMode: null
                //专业类型
                , majorType1: null
                , majorType2: null
                , majorType3: null

                //是否有关联单
                , nls8f: null
                //已有ONU标识
                , s3089: null
                //建设模式
                , s71q7: null
                // 客户类别
                , e2i17: null
                //设备类型不包含
                ,noz7r30: null
                //安装地址
                , noinstallationAddress: null
            }
            , parseData: function (res) { //res 即为原始返回的数据
                console.info(res)
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": res.count, //解析数据长度
                    "data": res.data //解析数据列表
                };
            }
        });
        var $ = layui.$, active = {
            reload: function () {
                var demoReload = $('#demoReload');
                var demoReload1 = $('#demoReload1');
                var demoReload2 = $('#demoReload2');
                var demoReload3 = $('#demoReload3');
                var demoReload4 = $('#demoReload4');
                var demoReload5 = $('#demoReload5');
                var demoReload6 = $('#demoReload6');
                var demoReload7 = $('#demoReload7');
                var demoReload8 = $('#demoReload8');
                var demoReload9 = $('#demoReload9');
                var demoReload10 = $('#demoReload10');
                var demoReload11 = $('#demoReload11');
                //执行重载
                table.reload('table', {
                    page: {
                        curr: 1 //重新从第 1 页开始
                    }
                    , where: {
                        //设备类型
                        z7r30: demoReload.val()
                        //安装地址
                        , installationAddress: demoReload1.val()
                        //接入方式
                        , accessMode: demoReload2.val()
                        //专业类型
                        , majorType1: demoReload3.val()
                        // , majorType2: demoReload4.val()
                        // , majorType3: demoReload5.val()

                        //是否有关联单
                        , nls8f: demoReload6.val()
                        //已有ONU标识
                        , s3089: demoReload7.val()
                        //建设模式
                        , s71q7: demoReload8.val()
                        // 客户类别
                        , e2i17: demoReload9.val()
                        //设备类型不包含
                        ,noz7r30: demoReload10.val()
                        //安装地址
                        , noinstallationAddress: demoReload11.val()
                    }
                }, 'data');
            }
        };

        $('.layui-row .layui-btn').on('click', function () {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });


        //导出
        $('#export').on('click', function () {
            var demoReload = document.getElementById("demoReload").value;
            var demoReload1 = document.getElementById("demoReload1").value;
            var demoReload2 = document.getElementById("demoReload2").value;
            var demoReload3 = document.getElementById("demoReload3").value;
            // var demoReload4 = document.getElementById("demoReload4").value;
            // var demoReload5 = document.getElementById("demoReload5").value;
            var demoReload6 = document.getElementById("demoReload6").value;
            var demoReload7 = document.getElementById("demoReload7").value;
            var demoReload8 = document.getElementById("demoReload8").value;
            var demoReload9 = document.getElementById("demoReload9").value;
            var demoReload10 = document.getElementById("demoReload10").value;
            var demoReload11 = document.getElementById("demoReload11").value;
            var urlPath = window.document.location.href
            var number = urlPath.lastIndexOf("/");
            urlPath = urlPath.substring(0,number);
            urlPath = urlPath + "/export?z7r30="+demoReload+"&installationAddress="+demoReload1+"&accessMode="+demoReload2+"&majorType1="+demoReload3+"&nls8f="+demoReload6+"&s3089="+demoReload7+"&s71q7="+demoReload8+"&e2i17="+demoReload9+"&noz7r30="+demoReload10+"&noinstallationAddress="+demoReload11
            window.open(urlPath);
        });


        //重置条件
        $('#reset').on('click', function () {
            $('#demoReload').val("");
            $('#demoReload1').val("");
            $('#demoReload2').val("");
            $('#demoReload3').val("");
            $('#demoReload4').val("");
            $('#demoReload5').val("");
            $('#demoReload6').val("");
            $('#demoReload7').val("");
            $('#demoReload8').val("");
            $('#demoReload9').val("");
            $('#demoReload10').val("");
            $('#demoReload11').val("");
        });

        //清空数据的函数
        $('#delete').on('click', function () {
            layer.open({
                content: '是否确定删除'
                , btn: ['确定', '取消']
                , yes: function (index, layero) {
                    //按钮【按钮一】的回调
                    console.info("yes")
                    $.ajax({
                        url: "/bussiness/delete",
                        success: function (res) {
                            layer.alert('删除数据成功', {
                                icon: 6
                            })
                        }
                        , error: function (res) {
                            layer.alert('删除数据失败', {
                                icon: 5
                            })
                        }
                    });
                }
                , btn2: function (index, layero) {
                    //按钮【按钮二】的回调
                    //return false 开启该代码可禁止点击该按钮关闭
                }, cancel: function () {
                    //右上角关闭回调
                    //return false 开启该代码可禁止点击该按钮关闭
                }
            });
        });
    }


    //上传函数
    function upload() {
        var upload = layui.upload;
        console.info(1111);
        //执行实例
        var uploadInst = upload.render({
            elem: '#upload' //绑定元素
            , url: '/bussiness/upload' //上传接口
            , accept: 'file'
            , method: 'POST'
            , drag: true
            , done: function (res) {
                //上传完毕回调
                if(res.code == 0){
                    layer.alert('上传数据成功', {
                        icon: 6
                    })
                }
            }
            , success: function (res) {
                layer.alert('上传数据成功', {
                    icon: 6
                })
            }
            , error: function (res) {
                //请求异常回调
                layer.alert('上传数据失败', {
                    icon: 5
                })
            }
        });
    }

    layui.use('table', rendTable());

    //上传文件
    layui.use('upload', upload());
</script>
</body>

</html>